<?php
use think\Db;
// +----------------------------------------------------------------------
// | HisiPHP框架[基于ThinkPHP5开发]
// +----------------------------------------------------------------------
// | Copyright (c) 2016-2018 http://www.hisiphp.com
// +----------------------------------------------------------------------
// | HisiPHP承诺基础框架永久免费开源，您可用于学习和商用，但必须保留软件版权信息。
// +----------------------------------------------------------------------
// | Author: 橘子俊 <364666827@qq.com>，开发者QQ群：50304283
// +----------------------------------------------------------------------

// 为方便系统升级，二次开发中用到的公共函数请写在此文件，禁止修改common.php文件
// ===== 系统升级时此文件永远不会被覆盖 =====

function subjifenlog()
{

}
//积分日志
 function jifenlog($orderNum,$userid,$cash = '0.00',$type = '0',$status = '0',$beizhu='',$gamename='')
 {
 
     $data ['orderid'] = $orderNum;
     $data ['userid'] = $userid;//会员id
     $data ['jifen'] = $cash; //变动积分
     $data ['type'] = $type;  //type=1 增加 0减少 2充值
     $data ['status'] = $status; //1成功 0失败
     $data ['beizhu'] =$beizhu;
     $data ['gamename'] =$gamename;
     
     $flag = Db::name('jifen_log')->insert( $data );
     return $flag;
     
 }

 function getUser($userid=null)
 {
 	if(!$userid){
 		echo 'need login'; die();
 	}
 	
 	$userdet = Db::name('User')->field('id,name,jifen,phone,runaddress')->find($userid);
 	
 	return $userdet;
 }	